USE TrackingStore

GO

/****** INSERT CANDIDATE EVALUATION PROCESS WORKFLOW TRACKING PROFILE ******/

EXEC [dbo].[UpdateTrackingProfile]	@TypeFullName = 'LitwareHR.Recruiting.Workflows.EvaluationProcess',
									@AssemblyFullName = 'LitwareHR.Recruiting.Workflows, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null',
									@Version = '1.0.0',
									@TrackingProfileXml = '<?xml version="1.0" encoding="utf-16" standalone="yes"?>
<TrackingProfile xmlns="http://schemas.microsoft.com/winfx/2006/workflow/trackingprofile" version="1.0.0">
    <TrackPoints>
        <WorkflowTrackPoint>
            <MatchingLocation>
                <WorkflowTrackingLocation>
                    <TrackingWorkflowEvents>
                        <TrackingWorkflowEvent>Created</TrackingWorkflowEvent>
                        <TrackingWorkflowEvent>Completed</TrackingWorkflowEvent>
                        <TrackingWorkflowEvent>Idle</TrackingWorkflowEvent>
                        <TrackingWorkflowEvent>Suspended</TrackingWorkflowEvent>
                        <TrackingWorkflowEvent>Resumed</TrackingWorkflowEvent>
                        <TrackingWorkflowEvent>Persisted</TrackingWorkflowEvent>
                        <TrackingWorkflowEvent>Unloaded</TrackingWorkflowEvent>
                        <TrackingWorkflowEvent>Loaded</TrackingWorkflowEvent>
                        <TrackingWorkflowEvent>Exception</TrackingWorkflowEvent>
                        <TrackingWorkflowEvent>Terminated</TrackingWorkflowEvent>
                        <TrackingWorkflowEvent>Aborted</TrackingWorkflowEvent>
                        <TrackingWorkflowEvent>Changed</TrackingWorkflowEvent>
                        <TrackingWorkflowEvent>Started</TrackingWorkflowEvent>
                    </TrackingWorkflowEvents>
                </WorkflowTrackingLocation>
            </MatchingLocation>
        </WorkflowTrackPoint>
        <ActivityTrackPoint>
            <MatchingLocations>
                <ActivityTrackingLocation>
                    <Activity>
                        <Type>System.Workflow.Activities.HandleExternalEventActivity, System.Workflow.Activities, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35</Type>
                        <MatchDerivedTypes>true</MatchDerivedTypes>
                    </Activity>
                    <ExecutionStatusEvents>
                        <ExecutionStatus>Initialized</ExecutionStatus>
                        <ExecutionStatus>Executing</ExecutionStatus>
                        <ExecutionStatus>Canceling</ExecutionStatus>
                        <ExecutionStatus>Closed</ExecutionStatus>
                        <ExecutionStatus>Compensating</ExecutionStatus>
                        <ExecutionStatus>Faulting</ExecutionStatus>
                    </ExecutionStatusEvents>
                </ActivityTrackingLocation>
            </MatchingLocations>
            <Extracts>
				<WorkflowDataTrackingExtract>
                    <Member>ApplicantUsername</Member>
                </WorkflowDataTrackingExtract>

				<WorkflowDataTrackingExtract>
                    <Member>RecruitingWorkflowId</Member>
                </WorkflowDataTrackingExtract>

				<WorkflowDataTrackingExtract>
                    <Member>TenantId</Member>
                </WorkflowDataTrackingExtract>

				<WorkflowDataTrackingExtract>
                    <Member>WaitingFor</Member>
                </WorkflowDataTrackingExtract>

				<WorkflowDataTrackingExtract>
                    <Member>NextStep</Member>
                </WorkflowDataTrackingExtract>

            </Extracts>
        </ActivityTrackPoint>
        <ActivityTrackPoint>
            <MatchingLocations>
                <ActivityTrackingLocation>
                    <Activity>
                        <Type>LitwareHR.Recruiting.Workflows.EvaluationProcess, LitwareHR.Recruiting.Workflows, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</Type>
                        <MatchDerivedTypes>true</MatchDerivedTypes>
                    </Activity>
                    <ExecutionStatusEvents>
                        <ExecutionStatus>Initialized</ExecutionStatus>
                        <ExecutionStatus>Executing</ExecutionStatus>
                        <ExecutionStatus>Canceling</ExecutionStatus>
                        <ExecutionStatus>Closed</ExecutionStatus>
                        <ExecutionStatus>Compensating</ExecutionStatus>
                        <ExecutionStatus>Faulting</ExecutionStatus>
                    </ExecutionStatusEvents>
                </ActivityTrackingLocation>
            </MatchingLocations>
            <Extracts>

                <ActivityDataTrackingExtract>
                    <Member>ApplicantUsername</Member>
                </ActivityDataTrackingExtract>

                <ActivityDataTrackingExtract>
                    <Member>RecruitingWorkflowId</Member>
                </ActivityDataTrackingExtract>

				<ActivityDataTrackingExtract>
                    <Member>TenantId</Member>
                </ActivityDataTrackingExtract>

                <ActivityDataTrackingExtract>
                    <Member>WaitingFor</Member>
                </ActivityDataTrackingExtract>

				<ActivityDataTrackingExtract>
                    <Member>NextStep</Member>
                </ActivityDataTrackingExtract>

            </Extracts>
        </ActivityTrackPoint>
    </TrackPoints>
</TrackingProfile>'


/****** INSERT RECRUITING PROCESS WORKFLOW PROFILE ******/

EXEC [dbo].[UpdateTrackingProfile]	@TypeFullName = 'LitwareHR.Recruiting.Workflows.RecruitingProcess',
									@AssemblyFullName = 'LitwareHR.Recruiting.Workflows, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null',
									@Version = '1.0.0',
									@TrackingProfileXml ='<?xml version="1.0" encoding="utf-16" standalone="yes"?>
<TrackingProfile xmlns="http://schemas.microsoft.com/winfx/2006/workflow/trackingprofile" version="1.0.0">
    <TrackPoints>
        <WorkflowTrackPoint>
            <MatchingLocation>
                <WorkflowTrackingLocation>
                    <TrackingWorkflowEvents>
                        <TrackingWorkflowEvent>Created</TrackingWorkflowEvent>
                        <TrackingWorkflowEvent>Completed</TrackingWorkflowEvent>
                        <TrackingWorkflowEvent>Idle</TrackingWorkflowEvent>
                        <TrackingWorkflowEvent>Suspended</TrackingWorkflowEvent>
                        <TrackingWorkflowEvent>Resumed</TrackingWorkflowEvent>
                        <TrackingWorkflowEvent>Persisted</TrackingWorkflowEvent>
                        <TrackingWorkflowEvent>Unloaded</TrackingWorkflowEvent>
                        <TrackingWorkflowEvent>Loaded</TrackingWorkflowEvent>
                        <TrackingWorkflowEvent>Exception</TrackingWorkflowEvent>
                        <TrackingWorkflowEvent>Terminated</TrackingWorkflowEvent>
                        <TrackingWorkflowEvent>Aborted</TrackingWorkflowEvent>
                        <TrackingWorkflowEvent>Changed</TrackingWorkflowEvent>
                        <TrackingWorkflowEvent>Started</TrackingWorkflowEvent>
                    </TrackingWorkflowEvents>
                </WorkflowTrackingLocation>
            </MatchingLocation>
        </WorkflowTrackPoint>
        <ActivityTrackPoint>
            <MatchingLocations>
                <ActivityTrackingLocation>
                    <Activity>
                        <Type>LitwareHR.Recruiting.Workflows.RecruitingProcess, LitwareHR.Recruiting.Workflows, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</Type>
                        <MatchDerivedTypes>false</MatchDerivedTypes>
                    </Activity>
                    <ExecutionStatusEvents>
                        <ExecutionStatus>Initialized</ExecutionStatus>
                        <ExecutionStatus>Executing</ExecutionStatus>
                        <ExecutionStatus>Canceling</ExecutionStatus>
                        <ExecutionStatus>Closed</ExecutionStatus>
                        <ExecutionStatus>Compensating</ExecutionStatus>
                        <ExecutionStatus>Faulting</ExecutionStatus>
                    </ExecutionStatusEvents>
                </ActivityTrackingLocation>
            </MatchingLocations>
            <Extracts>
                <WorkflowDataTrackingExtract>
                    <Member>TenantId</Member>
                </WorkflowDataTrackingExtract>
                <ActivityDataTrackingExtract>
                    <Member>PositionId</Member>
                </ActivityDataTrackingExtract>
            </Extracts>
        </ActivityTrackPoint>
        <ActivityTrackPoint>
            <MatchingLocations>
                <ActivityTrackingLocation>
                    <Activity>
                        <Type>System.Workflow.Activities.StateActivity, System.Workflow.Activities, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35</Type>
                        <MatchDerivedTypes>false</MatchDerivedTypes>
                    </Activity>
                    <ExecutionStatusEvents>
                        <ExecutionStatus>Initialized</ExecutionStatus>
                        <ExecutionStatus>Executing</ExecutionStatus>
                        <ExecutionStatus>Canceling</ExecutionStatus>
                        <ExecutionStatus>Closed</ExecutionStatus>
                        <ExecutionStatus>Compensating</ExecutionStatus>
                        <ExecutionStatus>Faulting</ExecutionStatus>
                    </ExecutionStatusEvents>
                </ActivityTrackingLocation>
            </MatchingLocations>
            <Extracts>
                <WorkflowDataTrackingExtract>
                    <Member>TenantId</Member>
                </WorkflowDataTrackingExtract>
                <WorkflowDataTrackingExtract>
                    <Member>PositionId</Member>
                </WorkflowDataTrackingExtract>
            </Extracts>
        </ActivityTrackPoint>
    </TrackPoints>
</TrackingProfile>'
